import React from 'react';
import {inject, observer} from 'mobx-react';
import { withRouter } from 'react-router-dom';
import { Avatar } from 'weaver-mobile';
import { ListPage } from 'weaver-mobile-page';
import { toJS} from 'mobx';
import MeetingUtil from '../../../util/meetingUtil';
import '../../../style/index';
const Normal = ListPage.Normal; // Normal 为无路由的普通组件

@inject('viewMeetingStore')
@withRouter
@observer
class DiscussHrm extends React.Component {
  constructor(props) {
      super(props);
      this.state = {
      };
    }
    componentDidMount() {
    }

    render() {
      const {  viewMeetingStore} = this.props;
      const { exchangeListStore } = viewMeetingStore;
      let mobileshowtemplate = {};
      mobileshowtemplate = {
        default: [
          {
            key: 'col1',
            style: { flex: 'none' },
            render(a) {
              return <Avatar name={toJS(a).hrmName} url={toJS(a).url} />;
            },
          },
          {
            key: 'col2',
            configs: [
              { key: 'col2-row1', configs: [{ key: 'hrmName' }],style:{color:'#333'} },
              { key: 'col2-row2', configs: [{ key: 'desc' }] },
            ],
          },
        ],
      };
      const memberHeight = this.getHeight();
        return (
          <div style={{ height: "100%" }}>
            <div style={{height:memberHeight,overflowY:'auto'}} className={'member-detail-contain'}>
              <Normal
                template={mobileshowtemplate}
                store={exchangeListStore}
              />
            </div>
        </div>
        )
    }

    getHeight = () => {
      return document.body.clientHeight - MeetingUtil.getTabHeight();
    }
}

export default DiscussHrm;